import { useEffect, useState } from 'react'
import * as fileSvr from '~/core/FileService'
import FileBox from '~/components/FileBox'
import FileItem from '~/components/FileItem'
import { useQuery } from '~/hooks'

function NotFound() {
    const [data, setData] = useState([])
    const q = useQuery()
    console.log(q)
    useEffect(() => {
        fileSvr.getList(q ?? '').then(r => {
            setData(r.result)
            console.log(r)
        })
    },[q])
    return (
        <div>
            <FileBox>
              {  data.map((x) => <FileItem key={x.name} info={x} />) }
            </FileBox>
        </div>
    )
}

export default NotFound